package com.hmall.mapper;

import com.hmall.model.MallPaymentVoucher;
import com.hmall.util.MyMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

@Repository
public interface MallPaymentVoucherMapper extends MyMapper<MallPaymentVoucher> {


    List<MallPaymentVoucher> selectByCustomerUserIdList(@Param("startTime") Date startTime, @Param("endTime") Date endTime,
                                                        @Param("customerUserIdList") List<Integer> customerUserIdList);

    int selectCountByTime(@Param("start") Date start, @Param("end") Date end, @Param("customerId") Integer customerId);

    List<MallPaymentVoucher> selectByCustomerUserIdListWithStatus(@Param("startTime") Date startTime, @Param("endTime") Date endTime,
                                                                  @Param("customerUserIdList") List<Integer> customerUserIdList,
                                                                  @Param("status") int status);

    Integer selectUnExamVoucher(@Param("customerId") Integer customerId);

    MallPaymentVoucher selectByOrderNo(@Param("orderNo") Long orderNo);

    MallPaymentVoucher selectLatestVoucher(@Param("customerId") Integer customerId);

    List<MallPaymentVoucher> selectListByOrderNo(@Param("orderNo") Long orderNo);
}